<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Contact</title>
    </h:head>
    <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
        <f:view beforePhase="#{ContactManagedBean.initView}">
            <h:body>
                <h:form prependId="false">
                    <!-- IDLE DIALOG for -->
                    <p:confirmDialog message="You have been idle for 5 minutes. Do you want to continue?"  
                                     showEffect="bounce" hideEffect="explode"  
                                     header="Warning message" severity="alert" widgetVar="confirmation">  
                        <p:commandButton value="Yes" onclick="confirmation.hide()" type="button" /> 
                        <p:commandButton value="No" update="panel" oncomplete="confirmation.hide()"  
                                         actionListener="#{UserManagedBean.doLogout}" /> 
                    </p:confirmDialog>

                    <p:idleMonitor timeout="300000" onidle="confirmation.show()" />  
                    <!--END OF IDLE DIALOG-->

                    <p:growl id="msgs" showDetail="true" />
                    <p:growl id="notif" showDetail="true"/> 
                    <div id="top" class="top">
                        <h:graphicImage value="/image/newHeader.jpg"/>
                    </div>
                    <div id="content">                
                        <p:poll interval="5"   
                                actionListener="#{MessageManagedBean.checkNewMessage}" immediate="true" update="notif" />
                        <table >
                            <tr>
                                <td>
                                    <p:toolbar style="font-size:12px;margin-top:0%;height:30px;width:200px"> 
                                        <p:toolbarGroup align="right">
                                            <p:button title="Home" image="ui-icon-home" outcome="SalesDeptWorkspace"/>                                   
                                            <p:button title="Notes" image="ui-icon-note" outcome="tasks"/>                                    
                                            <p:button title="Mail" outcome="messages" image="ui-icon-mail-closed"/>                                     
                                            <p:button title="Edit Preferences" image="ui-icon-gear"/>                                    
                                            <p:button title="Help" image="ui-icon-help"/>
                                            <p:commandButton title="Log Out" immediate="true" type="submit" image="ui-icon-close" actionListener="#{UserManagedBean.doLogout}" /> 
                                        </p:toolbarGroup>
                                    </p:toolbar>
                                </td>
                                <td> <h:graphicImage value="telp.png" style="width:40px;height:40px" />
                                    <h:outputText value="         "/>
                                    <h:outputText value="Contacts" style="font-family:Tahoma;font-size:20px;font-weight:bolder"/>
                                    <p:spacer width="100" height="10"/></td>
                            </tr>
                            <tr>

                                <td style="vertical-align:top">
                                    <p:menu style="width:200px;font-size: 12px;font-family: Tahoma;border-style: ridge">  
                                        <p:submenu label="Sales Force Automation" >  
                                            <p:menuitem value="Customers" url="http://localhost:8080/MerlionERP-war/CRM/customers.xhtml" ajax="false" icon="ui-icon ui-icon-person"/>  
                                            <p:menuitem value="Contacts" url="http://localhost:8080/MerlionERP-war/CRM/contacts.xhtml" ajax="false" icon="ui-icon ui-icon-person" />
                                            <p:menuitem value="Leads" url="http://localhost:8080/MerlionERP-war/CRM/salesLeads.xhtml" ajax="false" icon="ui-icon ui-icon-person" />
                                        </p:submenu>
                                        <p:submenu label="Sales Order Processing">
                                            <p:menuitem value="Pricebooks" url="http://localhost:8080/MerlionERP-war/CRM/pricebooks.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Inquiries" url="http://localhost:8080/MerlionERP-war/CRM/salesInquiries.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Quotations" url="http://localhost:8080/MerlionERP-war/CRM/quotations.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Purchase Orders" url="http://localhost:8080/MerlionERP-war/CRM/purchaseOrders.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Sales Orders" url="http://localhost:8080/MerlionERP-war/CRM/salesOrders.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                            <p:menuitem value="Delivery Orders" url="http://localhost:8080/MerlionERP-war/CRM/deliveryOrdersCRM.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                        </p:submenu>  
                                    </p:menu>
                                    <p:menu type="tiered" style="width:200px;font-family:Tahoma;font-size:12px">
                                        <p:submenu label="Create New" icon="ui-icon ui-icon-extlink">  
                                            <p:menuitem value="Customer" url="http://localhost:8080/MerlionERP-war/CRM/createNewCustomer.xhtml" />
                                            <p:menuitem value="Sales Lead" url="http://localhost:8080/MerlionERP-war/CRM/createNewSalesLead.xhtml" /> 
                                            <p:menuitem value="Contact" url="http://localhost:8080/MerlionERP-war/CRM/createNewContact.xhtml" />
                                            <p:menuitem value="Inquiry" url="http://localhost:8080/MerlionERP-war/CRM/addSalesInquiry.xhtml"/>
                                            <p:menuitem value="Quotation" url="http://localhost:8080/MerlionERP-war/CRM/addQuotation.xhtml"/>
                                            <p:menuitem value="Purchase Order" url="http://localhost:8080/MerlionERP-war/CRM/addPurchaseOrder.xhtml"/>
                                            <p:menuitem value="Sales Order" url="http://localhost:8080/MerlionERP-war/CRM/addSalesOrder.xhtml"/>
                                            <p:menuitem value="Delivery Order" url="http://localhost:8080/MerlionERP-war/CRM/addDeliveryOrder.xhtml"/>      
                                        </p:submenu>
                                    </p:menu>
                                    <p:calendar mode="inline" style="font-size:11px;font-family:Tahoma"/>
                                </td>

                                <td style="vertical-align:top">

                                    <p:toolbar style="background-color:  #d9bb73;font-size: 70%;width:99.5%"> 
                                        <p:toolbarGroup align="left">  
                                            <p:button value="New Contact" outcome="createNewContact" image="ui-icon-plus"/>
                                            <p:commandButton value="Delete" title="Delete" image="ui-icon ui-icon-trash" oncomplete="deleteDialog.show()"/>   
                                            <p:commandButton value="Contact Report" ajax="false" immediate="true" actionListener="#{jasperManagedBean.generateContactReport}" />
                                        </p:toolbarGroup>  
                                    </p:toolbar> 

                                    <p:dataTable id="panel" 
                                                 var="contacts" value="#{ContactManagedBean.contacts}"                       
                                                 paginator="true" rows="5"  
                                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                                 rowEditListener="#{ContactManagedBean.onEditRow}"
                                                 rowsPerPageTemplate="5,10,15"  style="font-size:60%;width:100%"
                                                 selection="#{ContactManagedBean.selectedContacts}"
                                                 emptyMessage="No data found with given criteria" widgetVar="contactTable">  

                                        <f:facet name="header">                           
                                            <p:outputPanel style="text-align:right"  >
                                                <h:outputText value="Search all fields:" style="margin-left:820px" />  
                                                <p:inputText id="globalFilter" onkeyup="contactTable.filter()" style="right:-100px;width:120px" />  
                                            </p:outputPanel>
                                        </f:facet> 

                                        <p:column selectionMode="multiple"/>
                                        <!--style="border-left-color:transparent;border-right-color:transparent"-->

                                        <p:column headerText ="View" style="width:16px;border-right-color:transparent" >  
                                            <p:rowToggler />  
                                        </p:column> 

                                        <p:column headerText="Edit" style="width:20px;border-left-color:transparent;border-right-color:transparent">    
                                            <p:rowEditor/>
                                        </p:column>

                                        <p:column headerText="Del." style="width: 16px;border-left-color:transparent"> <!--"border-right-color:transparent"> --> 
                                            <!--DELETE-->
                                            <p:commandButton title="Delete" image="ui-icon ui-icon-trash" ajax="true" immediate="true"
                                                             update="panel" oncomplete="contactdialog.show()">
                                                <f:setPropertyActionListener target="#{ContactManagedBean.selectedContact}"
                                                                             value="#{contacts}"/>
                                            </p:commandButton>
                                        </p:column>



                                        <!--Contact ID-->
                                        <p:column sortBy="#{contacts.id}" filterBy="#{contacts.id}" filterMatchMode="contains"
                                                  filterStyle="width:50px" >
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->
                                            <f:facet name="header">
                                                <h:outputText value="ID"/>
                                            </f:facet>
                                            <h:outputText value="#{contacts.id}"/>
                                        </p:column>

                                        <!--CONTACT NAME-->
                                        <p:column headerText="Name" sortBy="#{contacts.firstName}" filterBy="#{contacts.firstName}" filterMatchMode="contains"
                                                  filterStyle="width:150px" >
                                            <!--style="border-left-color:transparent;border-right-color:transparent"> --> 
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputLabel value="#{contacts.firstName}" for="firstName"/>  
                                                    <h:outputLabel value=" #{contacts.lastName}" for="lastName"/>
                                                </f:facet>  
                                                <f:facet name="input">
                                                    <p:inputText id="firstName" value="#{contacts.firstName}" style="width:100%"/>
                                                    <p:inputText id="lastName" value="#{contacts.lastName}" style="width:100%"/>
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>   

                                        <!--CONTACT NUMBER-->
                                        <p:column headerText="Contact Number" sortBy="#{contacts.contactNum}"
                                                  filterBy="#{contacts.contactNum}" filterMatchMode="contains">
                                            <!--style="border-left-color:transparent;border-right-color:transparent"> --> 
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputText value="#{contacts.contactNum}" />  
                                                </f:facet>
                                                <f:facet name="input">
                                                    <p:inputText value="#{contacts.contactNum}" style="width:100%" />
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>  


                                        <!--EMAIL ADDRESS-->
                                        <p:column headerText="Email Address" sortBy="#{contacts.emailAddress}" 
                                                  filterBy="#{contacts.emailAddress}" filterMatchMode="contains">
                                            <!--style="border-left-color:transparent;border-right-color:transparent"> --> 
                                            <p:cellEditor>
                                                <f:facet name="output">  
                                                    <h:outputText value="#{contacts.emailAddress}" />  
                                                </f:facet>
                                                <f:facet name="input"> 
                                                    <p:inputText value="#{contacts.emailAddress}" style="width:100%" />
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>


                                        <!--COMPANY NAME-->
                                        <p:column headerText="Company Name" sortBy="#{contacts.companyName}" 
                                                  filterBy="#{contacts.companyName}" filterMatchMode="contains"
                                                  filterStyle="width:120px" >
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->
                                            <p:cellEditor>
                                                <f:facet name="output">
                                                    <h:outputText value="#{contacts.companyName}"/>
                                                </f:facet>
                                                <f:facet name="input">            
                                                    <h:selectOneMenu value="#{contacts.companyId}">
                                                        <f:selectItems value="#{ContactManagedBean.customerList}" var="customers"
                                                                       itemLabel ="#{customers.id} - #{customers.name}" itemValue="#{customers.id}"/>
                                                    </h:selectOneMenu>                                         
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>

                                        <!--DATE CREATED-->
                                        <p:column sortBy="#{contacts.dateCreated}" 
                                                  filterBy="#{contacts.dateCreated}" 
                                                  filterMatchMode="contains" >
                                            <!--style="border-left-color:transparent;border-right-color:transparent">-->
                                            <f:facet name="header">
                                                <h:outputText value="Date Created"/>
                                            </f:facet>
                                            <h:outputText value="#{contacts.dateCreated}"/>
                                        </p:column>


                                        <p:column style="width:32px">  
                                            <p:commandLink update="display1" oncomplete="editDialog.show()" title="Edit Details">  
                                                <p:graphicImage value="about_icon.png" style="width:20px;height:20px"/>
                                                <f:setPropertyActionListener value="#{contacts}" target="#{ContactManagedBean.selectedViewContact}" />  
                                                <f:setPropertyActionListener value="#{true}" target="#{ContactManagedBean.editMode}" />  
                                            </p:commandLink>                                                                
                                        </p:column>

                                        <p:rowExpansion>  
                                            <h:panelGrid id="display" columns="6" cellpadding="3"
                                                         style="font-family:Tahoma; font-size:10px;border-color:transparent;column-rule-style:hidden">

                                                <h:outputText value="Contact Id" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.id}" />

                                                <h:outputText value="Date Created" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.dateCreated}" />  

                                                <h:outputText value="Salutation" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.salutation}" />  

                                                <h:outputText value="Company Name" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.companyName}" /> 

                                                <h:outputText value="First Name" />  
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.firstName}" />

                                                <h:outputText value="Last Name" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.lastName}" />

                                                <h:outputText value="Phone Number" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.contactNum}" />

                                                <h:outputText value="Mobile Number" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.mobileNum}" />

                                                <h:outputText value="Fax Number" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.faxNum}" />  

                                                <h:outputText value="Title" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.title}" />  

                                                <h:outputText value="Department" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.department}" />

                                                <h:outputText value="Email Address" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.emailAddress}" />

                                                <h:outputText value="Lead Source" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.leadSource}" /> 


                                                <h:outputText value="Address" /> 
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.address}" />  

                                                <h:outputText value="Address State" /> 
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.addressState}" /> 

                                                <h:outputText value="Country" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.country}" />  

                                                <h:outputText value="City" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.city}" />  

                                                <h:outputText value="Postal Code" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.postalCode}" /> 

                                                <h:outputText value="Description" />
                                                <h:outputText value=":"/>
                                                <h:outputText value="#{contacts.description}" /> 

                                            </h:panelGrid>  
                                        </p:rowExpansion>

                                    </p:dataTable>  


                                    <!--DIALOG FOR DELETING A  SINGLE ROW-->
                                    <p:confirmDialog message="Are you sure you want to delete this contact?"  
                                                     showEffect="blind" hideEffect="blind"  
                                                     modal="true" header="Delete Contact" severity="alert" widgetVar="contactdialog">  
                                        <center>
                                            <p:commandButton value="Yes" update="panel" ajax="true" immediate="true" oncomplete="customerdialog.hide()"  
                                                             actionListener="#{ContactManagedBean.delete}" />  
                                            <p:commandButton value="No" onclick="contactdialog.hide()" type="button" />   
                                        </center>

                                    </p:confirmDialog>  


                                    <p:ajaxStatus style="width:16px;height:16px;">  
                                        <f:facet name="start">  
                                            <h:graphicImage value="25(2).gif" />  
                                        </f:facet>  

                                        <f:facet name="complete">  
                                            <h:outputText value="" />  
                                        </f:facet>  
                                    </p:ajaxStatus>
                                </td>
                            </tr>

                            <tr></tr>
                        </table>

                        <p:dialog header="Contact Detail" widgetVar="editDialog" resizable="false"  
                                  modal="true" width="800" showEffect="blind" hideEffect="blind">  
                            <center>
                                <h:panelGrid id="display1" columns="6" cellpadding="4" style="font-family:Tahoma; font-size:12px">  


                                    <h:outputText value="Contact Id" />  
                                    <h:outputText value=":"/>
                                    <h:outputText value="#{ContactManagedBean.selectedViewContact.id}" />  

                                    <h:outputText value="Date Created" />  
                                    <h:outputText value=":"/>
                                    <h:outputText value="#{ContactManagedBean.selectedViewContact.dateCreated}" />  


                                    <h:outputText value="Salutation" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.salutation}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <h:selectOneMenu  value="#{ContactManagedBean.selectedViewContact.salutation}"  rendered="#{ContactManagedBean.editMode}">
                                            <f:selectItem itemLabel="-None-" itemValue="-"/>
                                            <f:selectItem itemLabel="Mr." itemValue="Mr."/>
                                            <f:selectItem itemLabel="Mrs." itemValue="Mrs."/>
                                            <f:selectItem itemLabel="Ms." itemValue="Ms."/>
                                            <f:selectItem itemLabel="Dr." itemValue="Dr."/>
                                            <f:selectItem itemLabel="Prof." itemValue="Prof."/>
                                        </h:selectOneMenu>
                                    </h:panelGroup>  

                                    <h:outputText value="Company Name" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.companyName}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <h:selectOneMenu value="#{ContactManagedBean.selectedViewContact.companyId}" rendered="#{ContactManagedBean.editMode}">
                                            <f:selectItems value="#{ContactManagedBean.customerList}" var="customers"
                                                           itemLabel ="#{customers.id} - #{customers.name}" itemValue="#{customers.id}" />
                                        </h:selectOneMenu>  
                                    </h:panelGroup>  


                                    <h:outputText value="First Name" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.firstName}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.firstName}" rendered="#{ContactManagedBean.editMode}" required="true" label="First Name"/>  
                                    </h:panelGroup> 


                                    <h:outputText value="Last Name" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.lastName}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.lastName}" rendered="#{ContactManagedBean.editMode}" required="true" label="Last Name"/>  
                                    </h:panelGroup> 


                                    <h:outputText value="Phone Number" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.contactNum}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}" />  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.contactNum}" rendered="#{ContactManagedBean.editMode}" required="true" label="Phone Number"/>
                                    </h:panelGroup> 


                                    <h:outputText value="Mobile Number" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.mobileNum}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}" />  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.mobileNum}" rendered="#{ContactManagedBean.editMode}" required="true" label="Mobile Number"/>
                                    </h:panelGroup> 


                                    <h:outputText value="Fax Number" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.faxNum}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}" />  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.faxNum}" rendered="#{ContactManagedBean.editMode}" required="true" label="Fax Number"/>
                                    </h:panelGroup>

                                    <h:outputText value="Email Address" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.emailAddress}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.emailAddress}" rendered="#{ContactManagedBean.editMode}" required="true" label="Email Address"/>  
                                    </h:panelGroup>  

                                    <h:outputText value="Title" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.title}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}" />  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.title}" rendered="#{ContactManagedBean.editMode}" required="true" label="Title"/>
                                    </h:panelGroup> 

                                    <h:outputText value="Department" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.department}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}" />  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.department}" rendered="#{ContactManagedBean.editMode}" required="true" label="Department"/>
                                    </h:panelGroup> 



                                    <h:outputText value="Lead Source" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.leadSource}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>
                                        <h:selectOneMenu  value="#{ContactManagedBean.selectedViewContact.leadSource}" rendered="#{ContactManagedBean.editMode}">
                                            <f:selectItem itemLabel="-None-" itemValue=""/>
                                            <f:selectItem itemLabel="Advertisement" itemValue="Advertisement"/>
                                            <f:selectItem itemLabel="Employes Referral" itemValue="Employes Referral"/>
                                            <f:selectItem itemLabel="External Referral" itemValue="External Referral"/>
                                            <f:selectItem itemLabel="Partner" itemValue="Partner"/>
                                            <f:selectItem itemLabel="Public Relations" itemValue="Public Relations"/>
                                            <f:selectItem itemLabel="Seminar - Internal" itemValue="Seminar - Internal"/>
                                            <f:selectItem itemLabel="Seminar - Partner" itemValue="Seminar - Partner"/>
                                            <f:selectItem itemLabel="Trade Show" itemValue="Trade Show"/>
                                            <f:selectItem itemLabel="Web" itemValue="Web"/>
                                            <f:selectItem itemLabel="Word of Mouth" itemValue="Word of Mouth"/>
                                            <f:selectItem itemLabel="Other" itemValue="Other"/>                                           
                                        </h:selectOneMenu>
                                    </h:panelGroup>

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>                                   

                                    <h:outputText value="Mailing Street" /> 
                                    <h:outputText value=":"/>
                                    <h:panelGroup>
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.address}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}" />  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.address}" rendered="#{ContactManagedBean.editMode}" required="true" label="Address"/>
                                    </h:panelGroup>

                                    <h:outputText value="Mailing State" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.addressState}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.addressState}" rendered="#{ContactManagedBean.editMode}" required="true" label="State"/>  
                                    </h:panelGroup>  

                                    <h:outputText value="Mailing Country" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.country}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.country}" rendered="#{ContactManagedBean.editMode}" required="true" label="Country"/>  
                                    </h:panelGroup>  

                                    <h:outputText value="Mailing City" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.city}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.city}" rendered="#{ContactManagedBean.editMode}" required="true" label="City"/>  
                                    </h:panelGroup>    


                                    <h:outputText value="Mailing Code" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.postalCode}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.postalCode}" rendered="#{ContactManagedBean.editMode}" required="true" label="Postal Code"/>  
                                    </h:panelGroup>  

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>

                                    <h:outputText value="Description" />
                                    <h:outputText value=":"/>
                                    <h:panelGroup>  
                                        <h:outputText value="#{ContactManagedBean.selectedViewContact.description}" style="font-weight:bold" rendered="#{!ContactManagedBean.editMode}"/>  
                                        <p:inputText value="#{ContactManagedBean.selectedViewContact.description}" rendered="#{ContactManagedBean.editMode}" required="true" label="Description"/>  
                                    </h:panelGroup>  

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>
                                    <h:outputText value=""/>

                                    <h:outputText value=""/>
                                    <h:outputText value=""/>

                                    <p:outputPanel rendered="#{ContactManagedBean.editMode}" layout="block" style="text-align:right">  
                                        <p:commandButton value="Save" update="panel" actionListener="#{ContactManagedBean.save}"   
                                                         oncomplete="editDialog.hide()" image="ui-icon ui-icon-check" />  
                                        <p:commandButton value="Cancel" onclick="editDialog.hide()" type="button" image="ui-icon ui-icon-close"/>  
                                    </p:outputPanel>  


                                </h:panelGrid>  
                            </center>
                        </p:dialog>  


                        <!--DIALOG FOR DELETING MULTIPLE ROW OF CUSTOMER-->
                        <p:dialog header="Delete Selected Records" modal="true" widgetVar="deleteDialog">

                            <h:outputText value="You are about to permanently delete records." /><br /><br />
                            <h:outputText value="Are you sure you want to continue?" /><br /><br/>

                            <center>
                                <p:commandButton value="Yes" ajax="true" immediate="true" update="panel" 
                                                 oncomplete="deleteDialog.hide()" actionListener="#{ContactManagedBean.deleteContacts}" />
                                <p:commandButton value="No" oncomplete="deleteDialog.hide()" action="#{ContactManagedBean.cancelDelete()}" /> 

                            </center>
                        </p:dialog>

                    </div>

                    <div id="bottom" class="bottom">
                        <h:graphicImage value="/image/merlionfooter.jpg"/>
                    </div>
                </h:form>
            </h:body>
        </f:view>
    </f:view>
</html>